use rand::{rng,Rng};
pub struct Studentinfo{
    pub name: String,
    pub age: u8,
    pub gender: String,
    pub no:String
}

impl Studentinfo{
    pub fn learn(&self){
        println!("{} is learning",self.name);
    }

    pub fn sleep(&self){
        let secret_str =rng().random_range(1..101);   
        println!("{}在连续奋战40小时候后，太累了，瞌睡了{}分钟",self.name,secret_str);
    }
}

pub fn print_student(s: &Studentinfo){
    println!("{} is {} years old,性别:{}",s.name,s.age,s.gender);
}
